// home/enterprise/ProductDetails.js
import api from "../../utils/api.js";
import utils from "../../utils/utils.js";
import network from "../../utils/network.js";
import formatDate from "../../utils/format_date.js";
const app = getApp();


Page({

  /**
   * 页面的初始数据
   */
  data: {
    finish: true,
    product: null
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    network.postJson(this, api.chanpinDetails, {
      id: options.id
    }).then(res => {
      this.setData({
        product: res.data.data
      })
    })
  },

  /**
   * 用户点击右上角分享
   */
  // onShareAppMessage: function() {

  // }

  callTap() {
    wx.makePhoneCall({
      phoneNumber: this.data.product.phone
    })
  }
})